package com.itheima.tlias84.controller;

import com.itheima.tlias84.mapper.LogMapper;
import com.itheima.tlias84.po.LoginParam;
import com.itheima.tlias84.servrce.LoginService;
import com.itheima.tlias84.utils.ResultUtil;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    private static final Logger log = LoggerFactory.getLogger(LoginController.class);
    @Resource
    LoginService loginService;
    @Resource
    LogMapper logMapper;
    @PostMapping("login")
    public ResultUtil login(@RequestBody LoginParam param){
        ResultUtil login = loginService.login(param);
        return login;
    }
//    @GetMapping("log/page")
//    public ResultUtil insertLog(){
//        int i = logMapper.insertLog();
//        return i>0?ResultUtil.success():ResultUtil.fail();
//    }
}
